/* $Id: UserDetailsModel.java 129 2011-08-26 05:27:43Z altdotua@gmail.com $ */

package alt.djudge.frontend.server.models;

import java.util.List;
import java.util.Map;

import org.hibernate.criterion.Order;

import alt.djudge.frontend.server.Deployment;
import alt.djudge.frontend.server.datatypes.custom.SchoolOlympUserDetailsEntry;


public class UserDetailsModel
{
	private static CoreInterface<SchoolOlympUserDetailsEntry> core = Deployment.isGAE() ?  
		new AbstractBigtableModelCore<SchoolOlympUserDetailsEntry>()
		{
			@Override
			protected Order getOrdering()
			{
				return Order.asc("id");
			}
			
			@Override
			protected Class<SchoolOlympUserDetailsEntry> getEntryClass()
			{
				return SchoolOlympUserDetailsEntry.class;
			}

		}
	:
		new AbstractDBModelCore<SchoolOlympUserDetailsEntry>()
		{
			@Override
			protected Order getOrdering()
			{
				return Order.asc("id");
			}
			
			@Override
			protected Class<SchoolOlympUserDetailsEntry> getEntryClass()
			{
				return SchoolOlympUserDetailsEntry.class;
			}
		};
		
	public static List<SchoolOlympUserDetailsEntry> getAllEntries()
	{
		return core.getAllEntries();
	}

	public static List<SchoolOlympUserDetailsEntry> getEntries(Map<String, Object> map)
	{
		return core.getEntries(map);
	}
}
